<template>
	<view>
		<z-paging ref="paging" v-model="dataList" @query="queryList">
			<view  class="content">
				<view class="item" v-for="(item,index) in dataList" :key="index">
					<u--text :text="'提现金额：￥'+item.money" size="16px" bold color="#000" margin="0px 0px 10px 0px"></u--text>
					<u--text :text="'提现时间：'+timetrans(item.createtime)" size="16px" bold color="#000" margin="0px 0px 10px 0px"></u--text>
					<u--text :text="'提现状态：'+getStatus(item.status)" size="16px" bold color="#000"></u--text>
				</view>
			</view>

		</z-paging>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataList: []
			};
		},
		methods: {
			queryList(pageNo, pageSize) {
				this.$http.post('wanlshop/pay/withdrawLog', {
					page: pageNo,
					limit: pageSize
				}).then(res => {
					res.code == 1 ? this.$refs.paging.complete(res.data.data) : this.$refs.paging.complete(false)
				})
			},
			timetrans(date) {
				var date = new Date(date * 1000); //如果date为10位需要乘1000
				var Y = date.getFullYear() + '-';
				var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
				var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
				var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
				var m = (date.getMinutes() <10 ? '0' + date.getMinutes() : date.getMinutes());
				return Y + M + D + h +m;
			},
			getStatus(text){
				switch(text){
					case 'created':
						return '申请中'
					break;
					case 'successed':
						return '提现成功'
					break;
					case 'rejected':
						return '提现被据'
					break;	
				}
			}
		}
	}
</script>
<style>
	page{
		background: #f8f9fd;
	}
</style>
<style lang="scss" scoped>
.content{
	padding: 20rpx;
}
.item{
	background: #fff;
	border-radius: 10rpx;
	padding: 20rpx;
	margin-bottom: 20rpx;
}
</style>
